//动态原型模式
function Person(name){
    this.name=name;
    if(typeof this.getName!='function'){
        Person.prototype.getName=function(){
            console.log(this.name);
        }
    }
}
var person = new Person('wang')
var person2=new Person('zhang')
person.getName();
person2.getName();